<?php

namespace App\Jobs;

use App\Models\Mysql\XnSupplierGoods;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\DB;

class SupplierGoodsTImeIsUp implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    private $data;
//    public $tries = 3;
    public function __construct($data = [])
    {
        $this->data = $data;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
       Db::connection($this->data['db'])->table('xn_supplier_goods')->where('id',$this->data['goods_id'])->where('is_up',1)->update(['release'=>$this->data['status']]);
    }
}
